<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>forEach的用法</title>
	</head>
	<body>
		<script>
			let arr = [1,2,3,4]
			arr.forEach(function(i){
				console.log(i+1)
			})
			
			for(i=1;i<=arr.length;i++){
				console.log(i)
			}
		</script>
	</body>
</html>
